<?php
/**
 * @abstract: Header
 * @author: HoanVX
 * @version: $Id: header.php 73 2015-01-18 05:20:09Z voxuanhoan@gmail.com $
 */
// Keep search condition after search
$sPurpose = "";
$sCity = "";
$sDistrict = "";
$sCategory = "";
$sContent = "";
if (isset($_SESSION['doSearch']) && !empty($_SESSION['doSearch'])) {
	$sPurpose = $_SESSION['doSearch']['sPurpose'];
	$sCity = $_SESSION['doSearch']['sCity'];
	$sDistrict = $_SESSION['doSearch']['sDistrict'];
	$sCategory = $_SESSION['doSearch']['sCategory'];
	$sContent = $_SESSION['doSearch']['sContent'];
}

add_script('/js/common.js');
get_header("common");
?>
<body>
	<!-- header-section-starts -->
	<div class="header">
		<div class="container">
			<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
				<div class="container wow fadeInUp wrapSearchForm "
					data-wow-delay="0.4s">
					<form action="<?php echo get_the_permalink(138);?>" method="POST"
						id="headerFrm" class="form-inline" role="form">
						<div class="form-group">
							<label class="label">Mục đích</label><br />
							<?php echo TagUtils::genPulldown(array('name'=>"sPurpose", 'options' => CtEnum::$purpose, 'defaultSelected'=>$sPurpose));?>
						</div>
						<div class="form-group">
							<label class="label">Thành phố</label><br />
							<?php echo CityEnum::getCityPulldown (array ('class' => '', 'name' => 'sCity', 'defaultSelected'=> $sCity));?>
						</div>
						<div class="form-group">
							<label class="label">Quận / Huyện</label><br />
							<?php echo CityEnum::getDistrictPulldown(array('class'=> '', 'name' => 'sDistrict', 'defaultSelected'=>$sDistrict));
								TagUtils::inputTag(array('id' => 'hdnSDistrict', 'value'=>$sDistrict));
							?>
						</div>
						<div class="form-group">
							<label class="label">Danh mục</label><br />
							<?php echo TagUtils::genCategoryPulldown(array('class'=> '', 'name' => 'sCategory', 'defaultSelected'=>$sCategory));?>
						</div>
						<div class="form-group">
							<label class="label">Nội dung tìm</label><br />
							<div class="input-group">
								<input type="text" name="sContent" class="form-control" value="<?php echo $sContent;?>" placeholder="Nhập nội dung cần tìm" />
								<span class="input-group-btn ">
									<button class="btn btn-info " type="submit" name="doSearch">
										Tìm <span class="glyphicon glyphicon-search" aria-hidden="true"></span>
									</button>
								</span>
							</div>
						</div>
					</form>
				</div>
			</nav>
			<div class="top-header">
				<div class="logo">
					<a href="<?php echo home_url(); ?>" title="chợ trời việt nam"><img
						src="<?php bloginfo("stylesheet_directory");?>/images/logo.png"
						class="img-responsive" alt="" /></a>
				</div>
				<div class="queries">
					<p>
						Questions? Call us Toll-free!<span>1800-0000-7777 </span><label>(11AM
							to 11PM)</label>
					</p>
				</div>
				<div class="clearfix"></div>
			</div>
		</div>
		<div class="menu-bar">
			<div class="container">
				<div class="top-menu">
					<?php
					wp_nav_menu(array(
							'theme_location' => 'header-menu'
							, 'container' => ''
							, 'menu_id' => 'nav'
					));
					?>
				</div>
				<div class="login-section">
					<?php
					wp_nav_menu(array(
							'theme_location' => 'header-menu-right'
							, 'container' => ''
							, 'menu_id' => 'nav'
					));
					?>
				</div>
				<div class="clearfix"></div>
			</div>
		</div>
	</div>
	<!-- header-section-ends -->